@extends("agent.layouts.main")
<style>
    .card-body {
        width: 50%;
    }
    @media screen and (max-width: 1024px) {
        .card-body {
            width: 100% !important;
        }
    }
    .showMsg li {
        cursor: pointer;
        padding: 10px 8px;
        margin: 2px 0;
    }
    .showMsg li:hover {
        background-color: #f2f2f2;
    }
    [name=url]{
        cursor: not-allowed;
    }
    img{
        width: 150px;
        height: 150px;
    }
</style>
<meta name="csrf-token" content="{{ csrf_token() }}">
@section("content")
<div class="container-fiuld p-3" id="app">
    <div class="card">
        <div class="card-body">
            <form class="layui-form mt-3">
                <div class="row align-items-center">
                    <div class="col-2 text-right">
                        <label class="m-0">邀请URL:</label>
                    </div>
                    <div class="col-5">
                        <input readonly class="form-control" id="url" value="{{ isset($prom['url']) ? $prom['url'] : ''}}" name="url">
                    </div>
                    <div class="col-2">
                        <button type="button" class="btn btn-info">复制</button>
                    </div>
                </div>
                <div class="row mt-5">
                    <div class="col-2 text-right">
                        <label class="m-0">邀请二维码:</label>
                    </div>
                    <div class="col-4">
                        <img src="{{ isset($prom['qcode_img']) ? $prom['qcode_img'] : ''}}"/>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection
@section("js")
<script>
    layui.use(["layer"],function(){
        var $ = layui.$,layer = layui.layer;
        $(".btn").click(function(){
            var obj = $("[name=url]")[0];
            obj.select();
            document.execCommand("Copy");
            layer.msg("复制成功",{time:3000});
        });

    })
</script>
@endsection

